package edu.mobbuzz.web.base;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import org.apache.tapestry5.annotations.ApplicationState;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;

import edu.mobbuzz.web.state.Visit;

public class SimpleBasePage{

	@ApplicationState
	private Visit visit;
	private boolean visitExists;
	
	private DateFormat dateViewFormat = new SimpleDateFormat("dd/MM/yyyy");
	private DateFormat dateListFormat = new SimpleDateFormat("dd/MM/yyyy");

	@Inject
	private Messages messages;

	protected Messages getMessages() {
		return messages;
	}

	public DateFormat getDateViewFormat() {
		return dateViewFormat;
	}

	public DateFormat getDateListFormat() {
		return dateListFormat;
	}
	
	public String getDateFieldFormat() {
		return "%d/%m/%Y";
	}

	public Visit getVisit() {
		return visit;
	}

	public boolean isVisitExists() {
		return visitExists;
	}

}
